#include<stdio.h>
#include<stdlib.h>
struct stud_node*create()
{
	int num;
	char name[20];
	int score;
	int size = sizeof(struct stud_node);
	struct stud_node *head,*tail,*p;
	head = tail =NULL;
	scanf("%d%s%d",&num,name,&score);
	while(num!=0)
	{
		p=(struct stud_node*)malloc(size);
		p->num=num;
		strcpy(p->name,name);
		p->score=score;
		p->next=NULL;
		if(head==NULL)
		head = p;
		else 
		tail->next=p;
		tail = p;
		scanf("%d%s%d",&num,name,&score);
	}
		return head;
	} 
	void printlist (struct stud_node*L)
	{
		printf("%d %s %d",num,name,score);
	}
int main()
{
	create();
	printf();
	return 0; 
}
